package controle;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class AppContextListener implements ServletContextListener{

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		System.out.println("It is over, AppContextListener parou.");
	}

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		
		
		ArduinoIntervalController.inicializa();
		
		
		try {
			ArduinoConnect connect = new ArduinoConnect();
			System.out.println("You are now prepared, AppContextListener iniciou.");
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(-10);
		}
		
	}

}
